/**
 * 
 */
package design_pattern.template.bank;

/**
 * @author linzq
 * 
 */
public class MoneyMarketAccount extends Account {

  @Override
  protected double doGetAmount(String accountType, String accountNumber) {
    System.out.println("从数据库中读取账号号码及其类型所对应的存款额。");
    // retreive from database
    return Math.random() * 10000;
  }

  @Override
  protected String doGetAccountType() {
    System.out.println("读取账号类型");
    return "MONEY_MARKET";
  }

  /*
   * (non-Javadoc)
   * 
   * @see template.bank.Account#doCalcInterestRate()
   */
  @Override
  protected double doCalcInterestRate(String accountType) {
    System.out.println("读取账号类型：" + accountType + " 所对应的利率。");
    return Math.random() * 0.5;
  }

}
